<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no" />
	<title>首页</title>
	<link rel="stylesheet" type="text/css" href="../c/aui.css" />
	<link rel="stylesheet" type="text/css" href="../c/article.css" />
	<link rel="stylesheet" type="text/css" href="../c/animate.css" />
</head>
<body>
	<script id="sx-list" type="text/x-dot-template">
		{{ for(var i=0,it=it.data; i < it.length; i++) { }}
		{{? it[i].channel == 2}}
		<div class="aui-card-list video" id="id{{= it[i].id}}">
			<div class="aui-card-list-header aui-card-list-user" tapmode onclick="_u({{= it[i].uid }})">
				<div class="aui-card-list-user-avatar">
					<img suxiangw-src="{{= it[i].user.img ? _img(it[i].user.img,60,60) : '../i/touxiang.png' }}" src='../i/touxiang.png' class="aui-img-round" />
				</div>
				<div class="aui-card-list-user-name">
					{{= it[i].user.username}}
				</div>
				<div class="aui-card-list-user-info">{{= it[i].time }}</div>
			</div>
			<div tapmode onclick="_url({url:'article_view',id:{{= it[i].id}}})">
				{{? it[i].content }}<div class="content">{{= it[i].content }}</div>{{?}}
				<div class="aui-card-list-content-padded">
					<div class="aui-row">
						<div class="aui-col-xs-12">
							<img suxiangw-src="{{= _img(it[i].img,api.winWidth+200,api.winWidth) }}" src='../i/loading_200.png'  />
						</div>
						<div class="em"><em></em></div>
					</div>
				</div>
			</div>
			<div class="foot">
				<div class="l1" tapmode onclick="_url({url:'article_view',id:{{= it[i].id}}})"><img src="../i/a_click.png"><p>{{= it[i].click}}</p></div>
				<div class="l2 zan" tapmode onclick="_zan({{= it[i].id}},'','','article')"><img src="../i/a_zan{{= it[i].user_zan?'-s':''}}.png"><p>{{= it[i].zan_num}}</p></div>
				<div class="l3" tapmode onclick="_url({url:'article_view',id:{{= it[i].id}},gundong:1})"><img src="../i/a_ping.png"><p>{{= it[i].ping_num}}</p></div>
				<div class="l4" tapmode onclick="_fenxiang({id:{{= it[i].id}},_t:1,_name:'article',title:'{{= it[i].content}}',content:'{{= it[i].content}}'})"><img  style="width:1.2rem;" src="../i/a_fx.png"></div>
			</div>
		</div>
		{{??}}
		<div class="aui-card-list" id="id{{= it[i].id}}">
			<div class="aui-card-list-header aui-card-list-user" tapmode onclick="_u({{= it[i].uid }})">
				<div class="aui-card-list-user-avatar">
					<img suxiangw-src="{{= it[i].user.img ? _img(it[i].user.img,60,60) : '../i/touxiang.png' }}" src='../i/touxiang.png' class="aui-img-round" />
				</div>
				<div class="aui-card-list-user-name">
					{{= it[i].user.username}}
				</div>
				<div class="aui-card-list-user-info">{{= it[i].time }}</div>
			</div>
			<div tapmode onclick="_url({url:'article_view',id:{{= it[i].id}}})">
				<div class="content">{{= it[i].content }}</div>
				<div class="aui-card-list-content-padded">
					<div class="aui-row {{? it[i].images.length!=1}}sx-col4{{?}}">
					{{ for(var i_s=0,images=it[i].images; i_s < images.length; i_s++) { }}
					{{? i_s < 9}}
						{{? images.length==1}}
						<div class="aui-col-xs-12">
						<img suxiangw-src="{{= _img(images[i_s],api.winWidth+300)}}" src='../i/loading_200.png' /></div>
						{{?? images.length==2 || images.length==4}}
						<div class="aui-col-xs-6">
						<img suxiangw-src="{{= _img(images[i_s],api.winWidth/2,api.winWidth/2)}}" src='../i/loading_200.png' /></div>
						{{??}}
						<div class="aui-col-xs-4">
						<img suxiangw-src="{{= _img(images[i_s],api.winWidth/2,200)}}" src='../i/loading_200.png' /></div>
						{{?}}
					{{?}}
					{{ } }}
					</div>
				</div>
			</div>
			<div class="foot">
				<div class="l1" tapmode onclick="_url({url:'article_view',id:{{= it[i].id}}})"><img src="../i/a_click.png"><p>{{= it[i].click}}</p></div>
				<div class="l2 zan" tapmode onclick="_zan({{= it[i].id}},'','','article')"><img src="../i/a_zan{{= it[i].user_zan?'-s':''}}.png"><p>{{= it[i].zan_num}}</p></div>
				<div class="l3" tapmode onclick="_url({url:'article_view',id:{{= it[i].id}},gundong:1})"><img src="../i/a_ping.png"><p>{{= it[i].ping_num}}</p></div>
				<div class="l4" tapmode onclick="_fenxiang({id:{{= it[i].id}},_t:1,_name:'article',title:'{{= it[i].content}}',content:'{{= it[i].content}}'})"><img  style="width:1.2rem;" src="../i/a_fx.png"></div>
			</div>
		</div>
		{{?}}
		{{ } }}
	</script>
	<section class="sx-list" id="sx-view">
	<div class="loading_by">
		<div class="a">
			<div class="a1"><span></span><span></span></div>
			<div class="a2"></div>
		</div>
		<div class="a">
			<div class="a1"><span></span><span></span></div>
			<div class="a2"></div>
		</div>
		<div class="a">
			<div class="a1"><span></span><span></span></div>
			<div class="a2"></div>
		</div>
		<div class="a">
			<div class="a1"><span></span><span></span></div>
			<div class="a2"></div>
		</div>
		<div class="a">
			<div class="a1"><span></span><span></span></div>
			<div class="a2"></div>
		</div>
		<div class="a">
			<div class="a1"><span></span><span></span></div>
			<div class="a2"></div>
		</div>
	</div>
	</section>
</body>
<script type="text/javascript" src="../j/api.js"></script>
<script type="text/javascript">
	var url = '',typeid,oxPlayer;
	apiready = function() {
		$('.loading_by').css('height',api.frameHeight+'px')
		typeid = api.pageParam['typeid'];
		oxPlayer = api.require('oxPlayer');
		url = 'article/lists/limit/6/typeid/'+typeid;
		_list({url:url});
		_shangla(function(ret,err){
			_list({url:url});
		},1)
		// 监听滚动
		api.addEventListener({
			name : 'scrolltobottom',
			extra : {threshold : api.winHeight/2}
		}, function(ret, err) {
			if (heigutgao == 1) {
				pagenum += 1
				_list({url:url,page:pagenum});
			}
		});
		// 回到屏幕
		api.addEventListener({
			name: 'viewappear'
		}, function(ret, err) {
		});
		// 离开屏幕
		api.addEventListener({
			name: 'viewdisappear'
		}, function(ret, err) {
			oxPlayer.remove();
		});
		//应用进入后台事件
		api.addEventListener({
			name: 'pause'
		}, function(ret, err) {
		});
		// 应用从后台回到前台事件
		api.addEventListener({
			name: 'resume'
		}, function(ret, err) {
			oxPlayer.pause();
		});
		api.addEventListener({
			name : 'keyback'
		}, function(ret, err) {
			oxPlayer.isFull(function(ret) {
				if(ret.isFull){
					oxPlayer.exitFullScreen();
				}else{
					_close();
				}
			});
		});
	}
	function video(data){
		var _this = $('#id'+data.id+' .aui-row img');
		var x = _this.offset().left;
		var y = _this.offset().top;
		var w = _this.width();
		var h = _this.height();
		var url = _sx_qiniu + data.url;
		var img = _this.attr('suxiangw-src');
		if(!img){
			img = _this.attr('src');
		}
		_video_open({url:url,img:img,w:w,h:h,y:y,x:x,radius:8,fixed:true});
		// 增加播放click
		_click(data.id,'article');
	}
</script>
</html>
